#include <iostream>
#include <unistd.h>
#include <time.h>
#include <string>
#include "log.hpp"
#include "Socket.hpp"




void Usage()
{
    std::cout << "\n\r" << "[Usage]: ip + port" <<"\n" << std::endl; 

}


int main(int argc ,char* argv[])
{
    
    if(argc != 3)
    {
        std::cout << argv[0] << argv[1] << argv[2] << std::endl;
        Usage();
        return -1;
    }

    Sock sock;
    sock.Socket();
    
    
    std::string ip = argv[1];
    std::string port_1 = argv[2];
    std::cout << "port: " << port_1 << std::endl;
    uint16_t port = std::stoi(port_1);
    if(sock.Connect(ip,port))
    {
        lg(INFO,"connect successful");
    }
    else
    {
        lg(INFO,"connect Failure");
    }
    
    sleep(10);

    
    return 0;
}